<template>
	<view class="amap-address-component">
		<view class="amap-address-list">
			<view
				v-for="(item, index) in list"
				:key="index"
				class="amap-address-item"
				@click="$emit('choose', item)"
			>
				<view class="address-header">
					<view class="name">
						<text
							v-for="(child, index) in item.fullNameList"
							:key="index"
							:class="{
								keyword: child.isHit === 1
							}"
						>{{ child.title }}</text>
					</view>
					<view v-if="item.distances" class="distance">{{ item.distances }}</view>
				</view>
				<view class="address-body">{{ item.cityname }}{{ item.adname }}{{ item.address }}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		list: Array
	}
}
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>